package com.code.refactoring.重构demo.状态机扭转.engine;

/**
 * @author wangxi03 created on 2021/4/29 2:32 下午
 * @version v1.0
 */

import com.code.refactoring.重构demo.状态机扭转.OrderStateEvent;
import com.code.refactoring.重构demo.状态机扭转.entity.OrderInfo;
import com.code.refactoring.重构demo.状态机扭转.entity.ServiceResult;

/**
 * 状态机执行引擎
 */
public interface OrderFsmEngine {
    /**
     * 执行状态迁移事件，不传FsmOrder默认会根据orderId从FsmOrderService接口获取
     */
    <T> ServiceResult<T> sendEvent(OrderStateEvent orderStateEvent) throws Exception;
    /**
     * 执行状态迁移事件，可携带FsmOrder参数
     */
    <T> ServiceResult<T> sendEvent(OrderStateEvent orderStateEvent, OrderInfo OrderInfo) throws Exception;
}
